package net.zjitc.bookshop15.util;

import lombok.Data;

@Data
public class ApiResponse<T> {
    private int statusCode;
    private String message;
    private T data;
    public ApiResponse(){}

    public ApiResponse(int statusCode, String message, T data) {
        this.statusCode = statusCode;
        this.message = message;
        this.data = data;
    }

   public  void oK( String message, T data) {
        this.statusCode = 200;
        this.message = message;
        this.data = data;
    }

    public  void error( Integer num,String message, T data) {
        this.statusCode = num;
        this.message = message;
        this.data = data;
    }
}
